home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS
/
PRO001.dsk
/
FIN
/
LOAN.LAST.PAYMT.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
1KB
|
35 lines
10 PRINT "LAST PAYMENT ON A LOAN
20 PRINT
29 REM - STATEMENTS 30 TO 130 REQUEST USER INPUT
30 PRINT "REGULAR PAYMENT";
40 INPUT R
50 PRINT "PRINCIPAL";
60 INPUT P
70 PRINT "TERM IN YEARS, MONTHS";
80 INPUT Y0,M
84 REM - CALCULATE YEARS FROM YEARS AND MONTHS
85 Y = (12 *Y0 +M)/12
90 PRINT "ANNUAL INTEREST RATE";
100 INPUT I
109 REM - CONVERT ITERST FROM PERCENT TO DECIMAL
110 I = I/100
120 PRINT "NUMBER OF PAYMENTS PER YEAR";
130 INPUT N
140 B0 = P
149 REM - COMPUTE ALL PAYMENTS, BALANCES THROUGH LAST PAYMENT USING R
150 FOR J1 = 1 TO N *Y
159 REM - ROUND OFF INTEREST PAID TO NEAREST CENT
160 I1 = INT((B0 *I/N) *100 +.5)/100
169 REM - CALCULATE AMOUNT AMORTIZED WITH EACH PAYMENT
170 A = R -I1
179 REM - BALANCE REMAINING DECREASES WITH EACH PAYMENT
180 B0 = B0 -A
190 NEXT J1
199 REM - CALCULATE LAST PAYMENT, ROUND OFF, PRINT
200 PRINT "LAST PAYMENT =$"; INT((R +B0) *100 +.5)/100
210 PRINT
219 REM - RESTART OR END PROGRAM?
220 PRINT "MORE DATA? (1=YES, 0=NO)";
230 INPUT X
240 IF X = 1 THEN 20
250 PRINT "<CTRL-D>RUN HELLO"